using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Zoo.View;
using Zoo.Controller;
using Zoo;
using System.Collections.Generic;

public partial class Search : PageBase,ISearchView
{
    private SearchController controller;

    protected override void OnInit(EventArgs e)
    {
        base.OnInit(e);
        IZooModel model = new ZooModel();
        controller = new SearchController(this, model);

    }

    protected void Page_Load(object sender, EventArgs e)
    {
        controller.Initialize();
        Page.DataBind();
    }
    #region ISearchView Members

    public string ErrorMessage
    {
        get
        {
            return LblErrorMessage.Text;
        }
        set
        {
            LblErrorMessage.Text = value;
        }
    }

    public ListItemCollection LanguageValues
    {
        get
        {
            return CblLanguage.Items;
        }
        set
        {
            Utility.CopyListItem(value, CblLanguage.Items);
        }
    }

    public ListItemCollection GenderValues
    {
        get
        {
            return RblGender.Items;
        }
        set
        {
            Utility.CopyListItem(value, RblGender.Items);
        }
    }

    public ListItemCollection SeekingValues
    {
        get
        {
            return RblSeeking.Items;
        }
        set
        {
            Utility.CopyListItem(value, RblSeeking.Items);
        }
    }

    

    public ListItemCollection UserLanguages
    {
        get
        {
            return CblLanguage.Items;
        }
        set
        {
            Utility.CopyListItem(value, CblLanguage.Items);
        }
    }

    public string Seeking
    {
        get
        {
            return RblSeeking.SelectedValue;
        }
        set
        {
            Utility.SetSelectedItem(RblSeeking, value);
        }
    }

    public int AgeMin
    {
        get
        {
            return Int32.Parse(TxbMinAge.Text);
        }
        set
        {
            TxbMinAge.Text = value.ToString();
        }
    }

    public int AgeMax
    {
        get
        {
            return Int32.Parse(TxbMaxAge.Text);
        }
        set
        {
            TxbMaxAge.Text = value.ToString();
        }
    }

    public int CountryID
    {
        get
        {
            return LocalizationControl1.CountryID;
        }
        set
        {
            LocalizationControl1.CountryID = value;
        }
    }

    public int RegionID
    {
        get
        {
            return LocalizationControl1.RegionID;
        }
        set
        {
            LocalizationControl1.RegionID = value;
        }
    }

    public string City
    {
        get
        {
            return TxtCity.Text;
        }
        set
        {
            TxtCity.Text = value;
        }
    }

    public event EventHandler CountrySelectedIndex_Change;

    public event EventHandler StartSearch;

   


    public string Gender
    {
        get
        {
            return RblGender.SelectedValue;
        }
        set
        {
            Utility.SetSelectedItem(RblGender, value);
        }
    }



    public Zoo.Domain.IdentityCard[] Result
    {
        get
        {
            return (Zoo.Domain.IdentityCard[])RepResult.DataSource; ;
        }
        set
        {
            RepResult.DataSource = value;
        }
    }

    #endregion
}
